//
//  UserInfoImageTableViewCell.m
//  huashiedu
//
//  Created by oceans on 2018/9/1.
//  Copyright © 2018年 hema. All rights reserved.
//

#import "UserInfoImageTableViewCell.h"

@implementation UserInfoImageTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.starView = [[HCSStarRatingView alloc] init];
    _starView.maximumValue = 5;
    _starView.tintColor = COLOR(255, 108, 96, 1);
    _starView.starBorderWidth = 0;
    _starView.spacing = 4;
    _starView.hidden = YES;
    _starView.userInteractionEnabled = NO;
    [self.contentView addSubview:_starView];
    [_starView setTranslatesAutoresizingMaskIntoConstraints:NO];
    
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_starView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_starView attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTrailing multiplier:1 constant:-15]];
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_starView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:70]];
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_starView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:15]];
    
    [self.contentView bringSubviewToFront:_faceImageView];
    _faceImageView.layer.cornerRadius = 22.5;
    _faceImageView.layer.masksToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
